package per.turtle.system.feign.factory;

import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import per.turtle.system.feign.RemoteLogService;
import per.turtle.system.feign.fallback.RemoteLogFallbackImpl;

/**
 * 日志服务降级处理
 *
 * @author turtle
 */
@Component
public class RemoteLogFallbackFactory implements FallbackFactory<RemoteLogService> {

    @Override
    public RemoteLogService create(Throwable throwable) {
        RemoteLogFallbackImpl fallback = new RemoteLogFallbackImpl();
        fallback.setCause(throwable);
        return fallback;
    }

}
